<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" import="java.util.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <title>User Manage</title>
    <link rel="stylesheet" type="text/css" href="/css/home.css">
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript" src="js/home.js"></script>

    <style>
        #user_info {
            background-color: #009688;
        }
    </style>

</head>
<body>
<div id="box">
    <%@ include file="header.jsp" %>
    <%@ include file="left.jsp" %>
    <div class="box1">
        <form action="/operation/serchUserByName" method="post">
            <input type="text" name="userName" placeholder="请输入用户名"
                   id="inputName"/> <input type="submit" value="点击搜索"
                                           id="submitSearch">
        </form>
        <%--        <input type="submit" value="查看全部"--%>
        <%--               id="searchAll">--%>
    </div>
    <div class="box2">
        <div class="box3">
            <table border="1">
                <tr height="40px">
                    <th width="180px" style="text-align: center;">用户id</th>
                    <th width="220px" style="text-align: center;">用户昵称</th>
                    <th width="180px" id="updateName" onclick="updateName()"
                        style="padding-left: 10px; padding-right: 10px; text-align: center;">修改
                    </th>
                    <th width="180px" style="text-align: center;">删除</th>
                </tr>
                <c:forEach items="${page.list }" var="user">
                    <tr align="center">
                        <td>${user.id }</td>
                        <td id="userName">${user.name }</td>
                        <td style="padding: 10px;">
                            <a href="">
                                <img src="/imgs/home/update.png" style="width: 20px; height: 20px;">
                            </a>
                        </td>
                        <td><a href="/operation/delete/${user.id }">
                            <img src="/imgs/home/delete.png" style="width: 20px; height: 20px;">
                        </a></td>
                    </tr>
                </c:forEach>
            </table>
            <div class="box4">
                <div class="box5">
                    总共有${page.totalPageNum }页，总共有${page.totalCount }个数据；&nbsp;&nbsp; <a
                        href="/loginContorller/homePage?page=1" style="color: black">首页</a>&nbsp;&nbsp;
                    <a href="/loginContorller/homePage?page=${page.prePageNum }" style="color: black">上一页</a>&nbsp;&nbsp;
                    <a href="/loginContorller/homePage?page=${page.nextPageNum }"
                       style="color: black">下一页</a>&nbsp;&nbsp; <a
                        href="/loginContorller/homePage?page=${page.totalPageNum }" style="color: black">末页</a>&nbsp;&nbsp;
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>